//
//  CustomHomeTableViewCell.m
//  DriftDog
//
//  Created by rimi on 15/9/13.
//  Copyright (c) 2015年 廖马林. All rights reserved.
//

#import "CustomHomeTableViewCell.h"

@implementation CustomHomeTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self.contentView addSubview:self.iconImageView];  // 添加左边的icon
        [self.contentView addSubview:self.titleLabel];
        [self.contentView addSubview:self.content];
        [self.contentView addSubview:self.timeLabel];
    }
    return self;
}

#pragma mark - getter

- (UIImageView *)iconImageView {
    
    if (!_iconImageView) {
        
        _iconImageView = [[UIImageView alloc] initWithFrame:DHFlexibleFrame(CGRectMake(5, 5, 100, 100), NO)];
        _iconImageView.layer.cornerRadius = 5 * DHFlexibleVerticalMutiplier();
        _iconImageView.layer.masksToBounds = YES;
        _iconImageView.backgroundColor = [UIColor grayColor];
    }
    return _iconImageView;
}

- (UILabel *)titleLabel {
    
    if (!_titleLabel) {
        
        _titleLabel = [[UILabel alloc] initWithFrame:DHFlexibleFrame(CGRectMake(120, 5, 230, 30), NO)];
        
        _titleLabel.text = @"联系我们";
        _titleLabel.textAlignment = NSTextAlignmentLeft;
        //_titleLabel.backgroundColor = [UIColor grayColor];
        _titleLabel.font = [UIFont systemFontOfSize:17 * DHFlexibleVerticalMutiplier()];
        _titleLabel.textColor = [UIColor colorWithWhite:90 / 255.f alpha:1];
    }
    return _titleLabel;
}

- (UILabel *)content {

    if (!_content) {
        
        _content = [[UILabel alloc] initWithFrame:DHFlexibleFrame(CGRectMake(120, 40, 270, 50), NO)];
        _content.textAlignment = NSTextAlignmentLeft;
        _content.text = @"详细信息详细信息详细信息详细信息详";
        //_content.backgroundColor = [UIColor orangeColor];
        _content.numberOfLines = 3;
        _content.textColor = [UIColor colorWithWhite:140 / 255.f alpha:1];
        _content.font = [UIFont systemFontOfSize:13 * DHFlexibleVerticalMutiplier()];
    }
    return _content;
}

- (UILabel *)timeLabel {

    if (!_timeLabel) {
        
        _timeLabel = [[UILabel alloc] initWithFrame:DHFlexibleFrame(CGRectMake(335, 85, 75, 30), NO)];
        _timeLabel.textAlignment = NSTextAlignmentLeft;
        _timeLabel.font = [UIFont systemFontOfSize:11 * DHFlexibleVerticalMutiplier()];
        _timeLabel.text = @"2015-09-11";
        _timeLabel.textColor = [UIColor colorWithWhite:0.4 alpha:1];
    }
    return _timeLabel;
}



@end
